package com.freexiaoyu.freevideoplay.FreeH;
import android.app.Activity;
import android.os.Bundle;
import android.view.SurfaceView;

import com.freexiaoyu.freevideoplay.R;

public class FreeHMainActivity extends Activity {

    private SurfaceView mSurfaceView;
    private Server mServer;
    private VideoDecoder mVideoDecoder;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_freeh);
        mSurfaceView = (SurfaceView) findViewById(R.id.surfaceView1);
        mServer = Server.getInstance();
        mVideoDecoder = new VideoDecoder(mSurfaceView.getHolder().getSurface(),
                mServer);
        mVideoDecoder.start();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
       try {
           mVideoDecoder.stop();
       }catch (Exception ex){

       }
    }
}